|
|
|
|
|
|
|
The analysis phase is similar to that discussed on Day 2. System design is concerned with the initial versions of the Object model, the Dynamic model, and the Functional model. The Object model shows the relationships (or links) between classes. The Dynamic model elaborates on states of objects and events associated with changes in state. The Functional model shows how the invoking of methods (or class operations) generates resulting values from a set of input values. The object design phase is an elaboration of the system design phase. Coding and testing aren't unlike that discussed on Day 4, Fundamental Object-Oriented Programming. Much OMT notation has been captured in the Unified Modeling Language (UML), which I'll explain in a moment. |
|
|
|
|
|
|
|
|
The Booch method, fathered by Grady Booch, proposes statements for designers to use in the elaboration of class structures and relationships. The statements follow this format: |
|
|
|
|
|
|
|
|
Candidate Class A is a type of Class B. |
|
|
|
|
|
|
|
|
Candidate Class A has a Class B type of object. |
|
|
|
|
|
|
|
|
Candidate Class A uses Class B. |
|
|
|
|
|
|
|
|
The is a relationship suggests that A is everything that B represents (and possibly more). This is called inheritance. For instance, a checking account is a type of account. |
|
|
|
|
|
|
|
|
The has a relationship suggests that A owns B for its own purposes, meaning that B's lifetime depends on A's lifetime. There has been much heated discussion on this very topic in the OO community. The idea is that, for instance, a bank customer has several accounts with the bank. When the customer stops being a bank customer, these accounts also cease as the customer closes them (at least in most cases). |
|
|
|
|
|
|
|
|
The uses relationship suggests that A uses B for a particular task or activity but doesn't own B. For instance, in the Second Bank of Carrollton Bank Teller System, the Account class might use the CheckingAccountHistoryInfo class to verify the customer's checking account history before opening a new account. The Account class doesn't own CheckingAccountHistoryInfo; Account just uses it for this verification process. In Visual Basic, a uses relationship might look like the following: |
|
|
|
|
|
|
|
|
cmdVerifyCheckAccountHistory_Click()
theAcount.verifyCheckAccountHistory(SomeCustomerSSN)
End Sub |
|
|
|
|
|